/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-19 19:31:21
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-19 19:31:26
 */
public class Bus extends Automobile {
    private int passengerCapacity;  // 巴士的乘客容量

    public Bus(String brand, String plateNumber, int passengerCapacity) {
        super(brand, plateNumber);
        this.passengerCapacity = passengerCapacity;
    }

    public int getPassengerCapacity() {
        return passengerCapacity;
    }

    public void setPassengerCapacity(int passengerCapacity) {
        this.passengerCapacity = passengerCapacity;
    }

    @Override
    public double getRent() {
        // 假设每位乘客的租金为 50 元
        return passengerCapacity * 50;
    }

    @Override
    public String toString() {
        return "Bus{" +
               "brand='" + getBrand() + '\'' +
               ", plateNumber='" + getPlateNumber() + '\'' +
               ", passengerCapacity=" + passengerCapacity +
               '}';
    }
}
